

import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.retry.RetryNTimes;
import org.junit.Test;

import java.util.concurrent.ConcurrentMap;

/**
 * Created with IntelliJ IDEA.
 * User: Tylaar
 * Date: 11/9/12
 * Time: 10:39 AM
 * Company: Amazon.com
 */
public class TestCuratorClient {
    @Test
    public void testCuratorConnection()throws Exception{
        String path = "/zk_test";
        //ConcurrentMap a;
        CuratorFramework client = CuratorFrameworkFactory.builder().connectString("162.105.146.28:2181").
                namespace("/brokers").retryPolicy(new RetryNTimes(Integer.MAX_VALUE, 1000)).connectionTimeoutMs(5000).build();
        client.start();
        client.create().forPath("/head", "testdata".getBytes());
        client.close();
    }
}
